Skip to content

added harper to the dependency graph - #4

Merged
BboyAkers merged 7 commits into
mainfrom
v5-upgrade
Aug 21, 2026
Merged

added harper to the dependency graph#4
BboyAkers merged 7 commits into
mainfrom
v5-upgrade

Conversation

@BboyAkers

@BboyAkers BboyAkers commented May 9, 2026

Copy link
Copy Markdown
Member

Harper v5 upgrade — completion (Path B)

This repo was already on harper@^5 (the dependency swap was done in the prior commit) but was missing the integration-testing setup. This PR completes the v5 upgrade: adds integration tests, the standard CI workflow, finishes the v4→v5 CLI/branding cleanup, and resyncs a stale lockfile.

Changes

  • Integration testing: added @harperfast/integration-testing@^0.4.0, typescript, @types/node, a test:integration script, and integrationTests/app.test.ts. The tests boot the full component as a fixture under v5 and verify:
    1. the component boots and the Dog table is defined (Operations API describe_all),
    2. insert / search_by_id / delete on the Dog table,
    3. the Next.js / and /dogs pages render (HTTP 200 HTML).
    • Architecture note: the @harperfast/nextjs plugin owns the public HTTP port and routes everything to the Next.js app, so the Dog @table @export REST endpoint is not reachable over HTTP. The Next.js server actions (app/actions.js) use that table through Harper's in-process Resource API (tables.Dog); the tests drive the same data layer via the Operations API.
  • harperBinPath fix (mandatory): harper's exports map only exposes ".", so the harness's auto-resolution of harper/dist/bin/harper.js throws ERR_PACKAGE_PATH_NOT_EXPORTED. The test resolves the CLI from the exported main entry and passes it explicitly as harperBinPath. (Upstream: harper should export its bin path, or the harness should resolve via the package root.)
  • Lockfile resync: package.json already requested harper@^5.0.10, but package-lock.json still pinned harper@5.0.3 and carried a stale ../harper extraneous local-path entry. Resolved harper to 5.0.28, removed the stale ../harper block, and preserved harper's optional native deps (bufferutil, utf-8-validate, node-gyp-build) — a macOS npm install had dropped them, which broke npm ci on Linux. npm ci verified clean on macOS and via --os=linux dry-run (glibc + musl).
  • Plugin bump: @harperfast/nextjs 2.0.02.2.1 (latest).
  • CI: added .github/workflows/integration-tests.yml (Node matrix 22/24/26, actions pinned to commit hashes).
  • v4→v5 CLI + branding cleanup in .github/workflows/build-and-deploy.yml: harperdb CLI → harper, @harperdb/nextjs@harperfast/nextjs, HarperDB log/artifact names → Harper.
  • README: harperdb deployharper deploy. Live docs.harperdb.io URLs left intact.

Migration items

This is a Next.js component that talks to Harper through the @harperfast/nextjs plugin and the Resource API (tables.Dog), via import('harper'). No v4 footprints found in source (no from 'harperdb', no blob.save(, no wasLoadedFromSource(, no harperdb-config.yaml). N/A migration items: harperdbharper import swap (already uses import('harper')), Table.get() return-shape / frozen records (server actions only read fields off the result), transaction/context changes, child-process spawning, blob storage, and module-loading/install-script config.

Tests

Local run (npm run test:integration, --isolation=none): 4/4 pass — the single-instance isolation mode binds to 127.0.0.1, so the usual macOS multi-loopback limitation does not block it. CI (Node 22/24/26 on ubuntu-latest) is the authoritative gate; see the Integration Tests check on this PR.

Notes / flags

  • The integration-test fixture boots the full component, which loads the @harperfast/nextjs plugin on startup. The plugin is not modified by this PR and boots cleanly under harper 5.0.28 + plugin 2.2.1 in local testing.
  • @harperdb/code-guidelines (devDependency + prettier config) is intentionally left on the @harperdb npm scope — no @harperfast variant is published. No manual npm-scope action needed.

🤖 Generated with Claude Code

- Add @harperfast/integration-testing with integration tests that boot the
  full component under v5: assert the Dog table is defined, exercise
  insert/read-by-id/delete on it via the Operations API (the @harperfast/nextjs
  plugin owns the HTTP port, so the @export REST endpoint is not HTTP-reachable;
  the Next.js server actions use the same data layer in-process), and assert the
  Next.js "/" and "/dogs" pages render
- Add test:integration script and integrationTests/tsconfig.json + typescript
- Add pinned-hash Integration Tests CI workflow (Node 22/24/26)
- Bump @harperfast/nextjs 2.0.0 -> 2.2.1; resync lockfile to harper 5.0.28
  (was pinned to stale 5.0.3 with a stale ../harper local entry), preserving
  harper's optional native deps (bufferutil/utf-8-validate/node-gyp-build) so
  npm ci works on Linux CI
- Update build-and-deploy workflow: harperdb CLI -> harper, @harperdb/nextjs
  -> @harperfast/nextjs, Harper branding
- README: harperdb deploy -> harper deploy

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

@BboyAkers BboyAkers left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review findings from automated analysis (v5-upgrade PR).

Comment thread package.json Outdated
Comment thread .github/workflows/build-and-deploy.yml
Comment thread package.json Outdated
Comment thread .github/workflows/integration-tests.yml
The scripts object was missing build, dev, start, lint, and format
entries, causing 'npm run build' in build-and-deploy.yml CI to fail
with 'missing script: build'. Restored all five scripts using the
correct commands for the @harperfast/nextjs v5 package.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@BboyAkers

Copy link
Copy Markdown
Member Author

Review follow-up (autonomous agent): Fixed blocking findings: restored missing npm scripts (build, dev, start, lint, format) in package.json so that 'npm run build' in build-and-deploy.yml CI no longer fails with 'missing script: build'.

Comment thread package.json Outdated
Comment thread integrationTests/tsconfig.json
BboyAkers and others added 3 commits August 10, 2026 12:33
Bump the harper dependency to ^5.2.1 and regenerate the lockfile.
Regenerated in full so the optional native deps (bufferutil,
utf-8-validate, segfault-handler) stay in the tree for Linux CI.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The previous lockfile was generated with npm 11, which does not
auto-install the peer dependencies of an optional dependency. harper
5.2.1 pulls alasql, which optionally depends on react-native-fs, whose
peers (react-native, react) npm 12 installs and npm 11 does not. CI runs
npm 12 on Node 24/26, so npm ci failed there with those packages
"missing from lock file" while Node 22 (npm 11) passed.

Regenerated with npm 12 so the lockfile carries the full tree.
lockfileVersion stays 3; npm ci verified under both npm 11 and npm 12.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…heck

Four of the six threads on #4 were still open.

dev script: @harperfast/nextjs@2.2.1 publishes no `bin`, confirmed both
against the registry and the installed package, so `harper-nextjs dev`
could never resolve — `npm run dev`, which the README tells readers to
run, failed with command not found. Switched to `harper dev .`; the
harper CLI is present at node_modules/.bin/harper.

eslint-config-next was pinned at 15.3.3 against next 15.5.15. Aligned to
15.5.15.

integrationTests/tsconfig.json did not actually typecheck. With
module: NodeNext and no "type" in package.json, TypeScript treated
app.test.ts as CommonJS: 13 TS1295 errors on the imports and 2 TS1470 on
import.meta. Added "type": "module", which also matches how Node already
runs the file (it was reparsing it as ESM with a
MODULE_TYPELESS_PACKAGE_JSON warning). Those 15 errors are gone; the only
one left is the pre-existing suite((ctx: ContextWithHarper) => ...)
overload mismatch common to every repo in this upgrade.

Safe here because all app code is already ESM and both configs are
explicit .mjs — verified with a full `npm run build`, which passes
including its lint and type-validity step.

Also documented the loopback constraint raised in the CI thread: the
integration job's ubuntu-latest is load-bearing, since the harness binds
each suite to 127.0.0.2+ and macOS/Windows runners need
harper-integration-test-setup-loopback (sudo) first.

Lockfile regenerated with npm 12; npm ci verified.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@BboyAkers
BboyAkers merged commit a04aaf2 into main Aug 21, 2026
4 checks passed
@BboyAkers
BboyAkers deleted the v5-upgrade branch August 21, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants